﻿using System;
using XEvolve.Core.Runtime.Internal;

namespace XEvolve.Core.Runtime
{
    public abstract class Platform
    {
        private static readonly PicoBasedPlatform current;

        static Platform()
        {
            current = new PicoBasedPlatform();
        }

        protected static Platform CreateDefault()
        {
            return new PicoBasedPlatform();
        }

        public static Platform Current
        {
            get { return current; }
        }

        public abstract IExtensionRegistry Registry { get; }
        public abstract IServiceLocator ServiceLocator { get; }

        public abstract void InstallPlugins(IPluginProvider pluginProvider);
        public abstract void RegisterService(Type api, Type implementation);
        public abstract void RegisterService(Type api, object instance);
        public abstract void RegisterService<Api, Implementation>();

        public abstract void Start();
        public abstract void Stop();
    }
}
